<?php use_helper('Date') ?>
<?php use_helper('jQuery') ?>
<div id="paginaEventos">
	<table height="500">
	  <thead valign="top">
	  	<tr>
	  		<td align="right" colspan="2">Próximos Eventos</td>
	  	</tr>
	  </thead>
	  <tbody valign="top">
	    <?php foreach ($eventoPager as $evento): ?>
	    <tr valign="top">
	      <td align="right"><?php echo format_datetime($evento->getFecha(), 'P', 'es_AR') ?></td>
	      <td>
			<a href="<?php echo url_for('principal/eventoView').'?id='.$evento->getId() ?>">
				<?php echo $evento->getTitulo() ?>
			</a>
		  </td>
	    </tr>
	    <tr valign="top">
	      <td align="right" colspan="2">El evento será en <?php echo $evento->getLugar()->getNombre() ?></td>
	    </tr>
	    <?php endforeach; ?>
	  </tbody>
	</table>
	
	<?php if ($eventoPager->haveToPaginate()): ?>
	<div class="pagination">
		<?php echo jq_link_to_remote('<<', array(
			'update' => 'paginaEventos',
			'url' => 'principal/cambiarPaginaEvento?eventoPage=1'))?>
		<?php echo jq_link_to_remote('<', array(
			'update' => 'paginaEventos',
			'url' => 'principal/cambiarPaginaEvento?eventoPage='.$eventoPager->getPreviousPage()))?>
		<?php foreach ($eventoPager->getLinks() as $page): ?>
			<?php if ($page == $eventoPager->getPage()): ?>
				<?php echo $page ?>
			<?php else: ?>
				<?php echo jq_link_to_remote($page, array(
					'update' => 'paginaEventos',
					'url' => 'principal/cambiarPaginaEvento?eventoPage='.$page))?>
			<?php endif; ?>
		<?php endforeach; ?> 
		<?php echo jq_link_to_remote('>', array(
			'update' => 'paginaEventos',
			'url' => 'principal/cambiarPaginaEvento?eventoPage='.$eventoPager->getNextPage()))?>
		<?php echo jq_link_to_remote('>>', array(
			'update' => 'paginaEventos',
			'url' => 'principal/cambiarPaginaEvento?eventoPage='.$eventoPager->getLastPage()))?>
	</div>
	<?php endif; ?>
	
	<div class="pagination_desc">
		<strong><?php echo $eventoPager->getNbResults() ?></strong>
		Eventos en total
		<?php if ($eventoPager->haveToPaginate()): ?>
			- página <strong><?php echo $eventoPager->getPage() ?>/<?php echo $eventoPager->getLastPage() ?></strong>
		<?php endif; ?>
	</div>
</div>